% -- A Ramsey Theory of Financial Distortions --
% Constrained steady state for the infinite-horizon model
% Writing Table 1 and Table 2

clc; clear; close all; format short


%% Initilization: parameters and functions

load param; % from calibration

par = par_calibrated; % this means that par is loaded from calibration

if isfield(par, 'G_Y')  == 1 
    par = rmfield(par, {'G_Y', 'I_Y', 'L_target'}); % remove par.G_Y etc as these are targets used for calibration
end

par.SIGMA       = 0.2;                  % which features a Laffer curve
par.ZETA_SS     = 1.01;                 % corresponding to 100 * (par.ZETA_SS - 1) growth rate of the Lagrangian multiplier; used in Table 2


%% Produce tables
cd steady_state_transition_AMPL

data_file = 'consumption_saving.dat'; % to be used in writing_data_to_AMPL.m
data_     = par; % to be used in writing_data_to_AMPL.m
writing_data_to_AMPL

%%%% run robustness with government expenditures
display('############# Attention! I am producing Table 1 ###########')
system('ampl table_1.run');

%%%% run robustness with financial frictions\
display('############# Attention! I am producing Table 2 ###########')
system('ampl table_2.run');
  
cd ..  

